import org.omg.CORBA.WStringSeqHelper;
import sun.applet.Main;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        //闰年 - Leapyear
        Scanner scanner = new Scanner(System.in);
        int num= scanner.nextInt();
        for (int year = 0; year <num; year++) {
            if(year%4==0&&year%100!=0||year%400==0)
                System.out.println(year+"是闰年");
        }
    }
    public static void main6(String[] args) {
        //scanner 工具  System.in: 键盘
        Scanner scanner = new Scanner(System.in);
        int a= scanner.nextInt();
        if(a%2==0){
            System.out.println("a是偶数");
        } else{
                System.out.println("a是奇数");
            }

    }
    public static void main5(String[] args) {
        System.out.println("\\\"hello\\\"");
        //\"hello\"
    }
    public static void main4(String[] args) {
        String str="1234";
        int a=Integer.parseInt(str);

    }
    public static void main3(String[] args) {
        int a=10;
        String str = a+"";
        System.out.println(str);

        String ret=String.valueOf(10);
        System.out.println(ret);

    }
    //main
    public static void main2(String[] args) {
        //sout
       // System.out.println("hello");
        //10.sout
       // System.out.println(10);
        //fori
       // for (int i = 0; i <10 ; i++) {}
        //fori -> p
       // for (int p = 0; p <10 ; p++) {}
       // System.out.println(Integer.MAX_VALUE);
       // System.out.println(Integer.MIN_VALUE);
        //int a=1;
        //int b=2;
        //System.out.println(a*1.0/b);
        int a=10,b=20;
        System.out.println(a+b);
        System.out.println("a:"+a +"b:"+b);
        System.out.println("a: "+a+b);//a: 1020
        System.out.println(a+b+"c:");//30 c

        ;
    }

    public static void main1(String[] args) {
        int a=1;
        int b=2;
        System.out.println(a*1.0/b);
    }
}
